package com.choupin.choupin.service.impl;

import com.choupin.choupin.entity.Member;
import com.choupin.choupin.mapper.MemberMapper;
import com.choupin.choupin.service.IMemberService;
import com.choupin.choupin.service.exception.SelectExcepion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@SuppressWarnings("ALL")
@Service
public class MemberImpl implements IMemberService {

    @Autowired
    MemberMapper memberMapper;

    @Override
    public List<Member> showMember() {
//        查询数据库获取会员信息
      List<Member> members=memberMapper.selectMember();
      if (members==null||members.size()<=0) {
          throw new SelectExcepion("会员不存在！");
      }
        return members;
    }
}
